﻿using System;
namespace RapidRepository
{
    /// <summary>
    /// Contains methods for serialisation and deserialisation of entities.
    /// </summary>
    internal interface ISerialiser
    {
        /// <summary>
        /// Serialises the specified type.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="objectToSerialise">The object to serialise.</param>
        string Serialise(Type type, object objectToSerialise);

        /// <summary>
        /// Deserialises the specified string.
        /// </summary>
        /// <typeparam name="T">The type of the object.</typeparam>
        /// <param name="stringToDeseralise">The string to deseralise.</param>
        T Deserialise<T>(string stringToDeseralise);

        /// <summary>
        /// Deserialises the specified view type.
        /// </summary>
        /// <param name="viewType">Type of the view.</param>
        /// <param name="stringToDeserialise">The string to deserialise.</param>
        object Deserialise(Type viewType, string stringToDeserialise);
    }
}
